<%-- Created by IntelliJ IDEA. --%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>生活日志</title>
    <style>
        a {
            text-decoration-line: none;
        }
    </style>
</head>
<body>
<%--页眉--%>
<jsp:include page="/layoutHeader.jsp"/>
<h1>个人中心</h1>
<div>
    <span>本月文章数${monthCount}</span>&nbsp;&nbsp;&nbsp;&nbsp;
    <span>年文章数${yearCount}</span>
</div>
<hr>
<%--账号是admin的才能添加文章--%>
<c:if test="${sessionScope.user.username.equals('admin')}">
    <a href="user?a=addClass">添加文章分类</a>&nbsp;&nbsp;&nbsp;&nbsp;
</c:if>

<a href="user?a=write">写文章</a>
<hr>
<h2>最近发表</h2>
<c:forEach items="${list}" var="v">
    <a href="article?a=details&id=${v.id}">${v.createTime}&nbsp;&nbsp;&nbsp;&nbsp;${v.title}</a><br><br>
</c:forEach>

</body>
</html>
